feat(new-repo): ship a self-testing privacy-guard pre-commit hook - #38
Merged
Conversation
#34) Hand-rolled name guards fail silently - the motivating field case passed everything, including a staged test leak, because of a GNU BRE quoting subtlety. Core now ships scripts/install-privacy-guard.ps1: patterns are case-insensitive literals (not regexes) entered locally and written only into .git/hooks/ (sh shim + generated pwsh guard), never the tree; a configured core.hooksPath refuses the install since it could be tracked; block messages name patterns by index so transcripts never spell the secret. Every install ends with a mandatory negative test in a throwaway fixture - clean stage passes, content leak, filename leak, and real-name identity each blocked - and removes the hook on any failure: a guard that has never failed a negative test is not yet a guard. Documented in the standard's Author identity and the pre-commit checklist; decided in ADR-0012; smoke-tested end-to-end through real git commits in CI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013g4xpqBjwwzfqtKyEHuWUr
PBNZ
added a commit
that referenced
this pull request
Aug 13, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013g4xpqBjwwzfqtKyEHuWUr
…en PRs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013g4xpqBjwwzfqtKyEHuWUr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Hand-rolled name guards fail silently — the motivating field case passed everything, including a staged test leak, because of a GNU BRE quoting subtlety. Core now ships
scripts/install-privacy-guard.ps1: patterns are case-insensitive literals (not regexes) entered locally and written only into.git/hooks/(sh shim + generated pwsh guard), never the tree; a configuredcore.hooksPathrefuses the install since it could be tracked; block messages name patterns by index so transcripts never spell the secret. Every install ends with a mandatory negative test in a throwaway fixture — clean stage passes; content leak, filename leak, and real-name identity each blocked — and removes the hook on any failure: a guard that has never failed a negative test is not yet a guard. Documented in the standard's Author identity and the pre-commit checklist; decided in ADR-0012; smoke-tested end-to-end through realgit commitruns in CI (newsmoke-privacy-guardjob).Refs #34
Checklist
Refs #NN(no auto-close keywords), if the repo tracks issues.feat: …,fix: …,docs: …).CHANGELOG.mdupdated under## [Unreleased]if user-visible.python scripts/*.py; see.github/workflows/validate.yml).docs/adr/for any notable decision.🤖 Generated with Claude Code
https://claude.ai/code/session_013g4xpqBjwwzfqtKyEHuWUr